package com.tanhua.model.vo;

import com.tanhua.model.db.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 用户信息表
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfoVoAge implements Serializable {

    private Long id;
    private String nickname; //昵称
    private String avatar; //用户头像
    private String gender; //性别
    private Integer age; //年龄
    private String city;
    //用户状态,1为正常，2为冻结
    private String userStatus = "1";
    private Long created;

    public static UserInfoVoAge init(UserInfo userInfo){
        UserInfoVoAge age = new UserInfoVoAge();
        age.setId(userInfo.getId());
        age.setAvatar(userInfo.getAvatar());
        age.setGender(userInfo.getGender());
        age.setAge(userInfo.getAge());
        age.setNickname(userInfo.getNickname());
        age.setCreated(userInfo.getCreated().getTime());
        age.setCity(userInfo.getCity());
        return age;
    }

}